package com.androidx.p013lv.mine.novel.view;

import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.androidx.p013lv.base.bean.NovelHistory;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.utils.SpUtils;
import com.androidx.p013lv.base.utils.UiUtils;
import com.androidx.p013lv.mine.C1207R;
import com.androidx.p013lv.mine.OnClickListenTypes;

/* renamed from: com.androidx.lv.mine.novel.view.NovelHistoryTwoView */
public class NovelHistoryTwoView {
    String domain;
    ImageView iv_cover;
    LinearLayout ll_item_layout;
    LinearLayout ll_label_tag;
    OnClickListenTypes onClickListenTypes;
    RelativeLayout rl_cover;
    TextView tv_favorites_num;
    TextView tv_label1;
    TextView tv_label2;
    TextView tv_label3;
    TextView tv_listen_num;
    TextView tv_title;

    public NovelHistoryTwoView(View view, String str) {
        this.domain = str;
        this.ll_item_layout = (LinearLayout) view.findViewById(C1207R.C1210id.ll_item_layout);
        this.rl_cover = (RelativeLayout) view.findViewById(C1207R.C1210id.rl_cover);
        this.iv_cover = (ImageView) view.findViewById(C1207R.C1210id.iv_cover);
        this.tv_title = (TextView) view.findViewById(C1207R.C1210id.tv_title);
        this.ll_label_tag = (LinearLayout) view.findViewById(C1207R.C1210id.ll_label_tag);
        this.tv_label1 = (TextView) view.findViewById(C1207R.C1210id.tv_label1);
        this.tv_label2 = (TextView) view.findViewById(C1207R.C1210id.tv_label2);
        this.tv_label3 = (TextView) view.findViewById(C1207R.C1210id.tv_label3);
        this.tv_listen_num = (TextView) view.findViewById(C1207R.C1210id.tv_listen_num);
        this.tv_favorites_num = (TextView) view.findViewById(C1207R.C1210id.tv_favorites_num);
        ViewGroup.LayoutParams layoutParams = this.rl_cover.getLayoutParams();
        layoutParams.height = UiUtils.dp2px(84);
        layoutParams.width = UiUtils.dp2px(84);
        this.rl_cover.setLayoutParams(layoutParams);
    }

    public void setView(NovelHistory novelHistory, int i) {
        this.tv_title.setText(novelHistory.getFictionTitle());
        TextView textView = this.tv_listen_num;
        textView.setText(UiUtils.num2str(novelHistory.getFakeWatchTimes()) + "");
        TextView textView2 = this.tv_favorites_num;
        textView2.setText(UiUtils.num2str(novelHistory.getFakeLikes()) + "");
        if (!TextUtils.isEmpty(novelHistory.getCoverImg())) {
            GlideUtils.loadCropRadiusWh2(SpUtils.getInstance().getString("domain") + novelHistory.getCoverImg(), 6, this.iv_cover, 600);
        } else {
            GlideUtils.loadCropRadiusDefault(6, this.iv_cover);
        }
        this.tv_label1.setVisibility(8);
        this.tv_label2.setVisibility(8);
        this.tv_label3.setVisibility(8);
        if (novelHistory.getTagList().size() > 0) {
            int size = novelHistory.getTagList().size();
            if (size == 1) {
                TextView textView3 = this.tv_label1;
                textView3.setText(novelHistory.getTagList().get(0) + "");
                this.tv_label1.setVisibility(0);
            } else if (size == 2) {
                TextView textView4 = this.tv_label1;
                textView4.setText(novelHistory.getTagList().get(0) + "");
                TextView textView5 = this.tv_label2;
                textView5.setText(novelHistory.getTagList().get(1) + "");
                this.tv_label1.setVisibility(0);
                this.tv_label2.setVisibility(0);
            } else if (size == 3) {
                TextView textView6 = this.tv_label1;
                textView6.setText(novelHistory.getTagList().get(0) + "");
                TextView textView7 = this.tv_label2;
                textView7.setText(novelHistory.getTagList().get(1) + "");
                TextView textView8 = this.tv_label3;
                textView8.setText(novelHistory.getTagList().get(2) + "");
                this.tv_label1.setVisibility(0);
                this.tv_label2.setVisibility(0);
                this.tv_label3.setVisibility(0);
            } else {
                TextView textView9 = this.tv_label1;
                textView9.setText(novelHistory.getTagList().get(0) + "");
                TextView textView10 = this.tv_label2;
                textView10.setText(novelHistory.getTagList().get(1) + "");
                TextView textView11 = this.tv_label3;
                textView11.setText(novelHistory.getTagList().get(2) + "");
                this.tv_label1.setVisibility(0);
                this.tv_label2.setVisibility(0);
                this.tv_label3.setVisibility(0);
            }
        }
    }
}
